package com.bjsxt.controller;

import com.bjsxt.pojo.Company;
import com.bjsxt.pojo.Host;
import com.bjsxt.pojo.PageA;
import com.bjsxt.service.HostService;
import org.omg.PortableInterceptor.INACTIVE;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/host")
public class HostController {
    @Autowired
    private HostService hostService;


    //查询实现
    @RequestMapping("/findMoreHost")
    public PageA<Host> findMoreHost(Integer page, Integer rows, Host host) {
        System.out.println(host);

        return hostService.findMore(page, rows, host);
    }

    //添加主持人信息
    @RequestMapping("/saveHost")
    public Integer saveHost(Host host) {

        return hostService.save(host);
    }

    //修改权重
    @RequestMapping("/changeStrong")
    public Integer changeStrong(Integer strong, Integer hid) {
        return hostService.updateStrong(strong, hid);
    }

    //批量修改状态实现
    @RequestMapping("/changStatus")
    public Integer updateStatus(Integer[] hids, String status) {
        return hostService.updateStatus(hids, status);
    }
}
